#ifndef _KLAS_ENGINE_HPP_
#define _KLAS_ENGINE_HPP_

#include "Platform.hpp"
#include "graphics/RenderingCore.hpp"

namespace klas
{
  namespace graphics
  {
    class Sprite;
    class Primitive;
    class RenderingCore;
    class Texture;
    class Color;
  }

  class KLAS_API Engine
  {
  public:
    
    //! Initialize the engine.
    /*! \param renderingLibrary The library to use for rendering.  Use klas::library(GL, DX, SF...) */
    static void init(uint8 renderingLibrary, const math::Vector2<int>& windowDim, string title, const graphics::Color& col, bool fullscreen);

    //! Renders the screen.
    /*! \param cam The dimensions and position of the screen to render.
        \param clearCache Remove everything from the rendering core if true. */
    static void render(const math::Rectd& cam, bool clearCache = true);

    //! Generate a new texture.
    static graphics::Texture* newTexture();

    //! Generate a new texture and have its data be loaded in from the filename.
    static graphics::Texture* newTexture(string filename);

  //private:

    // Everything that needs internal access is a friend class.
    friend class graphics::Sprite;
    friend class graphics::Primitive;

    static graphics::RenderingCore* renderingCore;  //! The universal rendering core.
    static uint8 graphicsLibrary;         //! What graphics library is being used to render.
    
  };
}

#endif